#include <stdio.h>
#include <stdlib.h>

struct ListNode {
    int data;
    struct ListNode *next;
};

struct ListNode *createlist();
struct ListNode *deleteeven( struct ListNode *head );
void printlist( struct ListNode *head )
{
    struct ListNode *p = head;
    while (p) {
        printf("%d ", p->data);
        p = p->next;
    }
    printf("\n");
}

int main()
{
    struct ListNode *head;
    
    head = createlist();
    head = deleteeven(head);
    printlist(head);
    
    return 0;
}

/* 你的代码将被嵌在这里 */
struct ListNode *creat()
{
    struct ListNode * ans=(struct ListNode*)malloc(sizeof(struct ListNode));
    ans->next=NULL;
    return ans;
}
struct ListNode *createlist()
{
    struct ListNode* head=NULL;
    for(struct ListNode* tail=head;;)
    {
        int data;
        scanf("%d",&data);
        if(data==-1)break;
        struct ListNode * tmp=creat();
        tmp->data=data;
        if(head)
            tail->next=tmp;
        else
            head=tmp;
        tail=tmp;
    }
    return head;
}
struct ListNode *deleteeven( struct ListNode *head )
{
    struct ListNode *i=NULL,*j=head;
    head=NULL;
    for(;j;)
        if(!(j->data&1))
        {
            struct ListNode *tmp=j->next;
            if(i)i->next=tmp;
            free(j);
            j=tmp;
        }
        else
        {
            if(!head)head=j;
            i=j;
            j=j->next;
        }
    return head;
}